<?php
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

/**
 * @var $block \Magento\Braintree\Block\Datajs
 */

$arrayData = [
    "kountId" => $this->helper('Magento\Braintree\Helper\Data')->getKountId() ?
        $this->helper('Magento\Braintree\Helper\Data')->getKountId() : false,
    "formId" =>$block->getFormId(),
    "merchantId" => $block->getMerchantId(),
    "braintreeDataJs" => $block->escapeUrl($block->getJsSrc()),
];
$serializedFormData = $this->helper('Magento\Framework\Json\Helper\Data')->jsonEncode($arrayData);
?>
<script type="text/x-magento-init">
    {
        "body": {
             "braintreeDataJs": <?php /* @noEscape */ echo $serializedFormData ?>
        }
    }
</script>
